package com.yanqu.road.server.manger.activity.zhenhuan.service;

import com.google.protobuf.InvalidProtocolBufferException;
import com.yanqu.road.dao.impl.activity.zhenhuan.UserZhenHuanPartyHistoryDaoImpl;
import com.yanqu.road.dao.impl.player.UserZhenHuanSecondDaoImpl;
import com.yanqu.road.entity.activity.zhenhuan.secondProcess.GameZhenHuanFinishPartyData;
import com.yanqu.road.entity.activity.zhenhuan.secondProcess.UserZhenHuanPartyHistoryData;
import com.yanqu.road.entity.activity.zhenhuan.secondProcess.UserZhenHuanSecondProcessData;
import com.yanqu.road.entity.activity.zhenhuan.secondProcess.ZhenHuanPartyUserSimpleInfo;
import com.yanqu.road.entity.enums.eGamePlayerEventType;
import com.yanqu.road.logic.activity.zhenhuan.ZhenHuanSecondProcessConfig;
import com.yanqu.road.pb.activity.ZhenHuanProto;
import com.yanqu.road.pb.player.PlayerProto;
import com.yanqu.road.pb.syncMessage.SyncMessage;
import com.yanqu.road.server.GameServer;
import com.yanqu.road.server.game.service.IGameServiceCommand;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.zhenhuan.ZhenHuanSecondProcessModule;
import com.yanqu.road.server.manger.activity.zhenhuan.ZhenHuanConfigMgr;
import com.yanqu.road.server.manger.activity.zhenhuan.ZhenHuanMgr;
import com.yanqu.road.server.manger.player.GamePlayerMgr;
import com.yanqu.road.server.manger.rank.ActivityRankMgr;
import com.yanqu.road.server.protocol.GameProtocol;
import com.yanqu.road.sync.message.SyncResponse;
import com.yanqu.road.utils.date.DateHelper;
import com.yanqu.road.utils.property.Property;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 茶话会结算同步下来
 */
public class ZhenHuanPartyFinishSyncServiceCmd implements IGameServiceCommand {
    @Override
    public SyncResponse execute(SyncMessage.Request request) throws InvalidProtocolBufferException {
        SyncResponse syncResponse = new SyncResponse();

        ZhenHuanMgr.addTask(request.getCmdCode(), 0, request.getDataBytes());

        ZhenHuanProto.CrossZhenHuanSecondProcessFinishPartySyncMsg syncMsg = ZhenHuanProto.CrossZhenHuanSecondProcessFinishPartySyncMsg.parseFrom(request.getDataBytes());

        ZhenHuanProto.ZhenHuanPromotionListSyncConfirmMsg.Builder confirmMsg = ZhenHuanProto.ZhenHuanPromotionListSyncConfirmMsg.newBuilder();
        confirmMsg.setActivityId(syncMsg.getActivityId());
        confirmMsg.setServerId(GameServer.getInstance().getServerId());

        syncResponse.setResponseBuilder(confirmMsg);

        return syncResponse;
    }
}
